package cn.pn.project.client.order;

import cn.pn.project.config.DmConfiguration;
import cn.pn.project.client.order.fallback.ItemOrderClientFallBack;
import cn.pn.project.pojo.commodity.Commodity;
import cn.pn.project.pojo.commodity.Sku;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 商品订单Client
 */
@FeignClient(name = "pn-item-provider", configuration = DmConfiguration.class/*, fallback = ItemOrderClientFallBack.class*/)
public interface RestItemOrderClient {

    /**
     * 多条件查询SKU对象（谢耀翔）
     *
     * @param param
     * @return
     * @throws Exception
     */
    @PostMapping("/getSkuByMap")
    public Sku getSkuByMap(@RequestParam Map<String, Object> param) throws Exception;

    /**
     * 多条件查询商品对象（xxxxxx谢耀翔）
     *
     * @param param
     * @return
     * @throws Exception
     */
    @PostMapping("/getCommodityByMap")
    public Commodity getCommodityByMap(@RequestParam Map<String, Object> param) throws Exception;


    /**
     * 多条件查询SKU集合   （谢耀翔）
     * @param param
     * @return
     * @throws Exception
     */
    @PostMapping("/getSkuListByMap")
    public List<Sku> getSkuListByMap(@RequestParam Map<String,Object> param)throws Exception;

}